<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <a name="link" id="home" href="">home</a>
    <a name="link" href="contract">contract</a>
    <a name="link" href="movie">movie</a>
    <script>
        var obj1 = document.getElementsByName("link");
        console.log(obj1[0]);
        var obj2 = document.getElementsByTagName("a");
        console.log(obj2[0]);
        var obj3 = document.getElementById("home");
        console.log(obj3);
    </script>
</body>

</html>